package com.anysoft.user;

import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.anysoft.R;
import com.anysoft.StaticField;
import com.anysoft.base.BaseActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * @ProjectName：gy_fund-android
 * @ClassDescription：
 * @CreateUser： yanbin
 * @CreateTime：2017-03-06 12:16
 * @ModifiedUser：
 * @ModifiedTime：
 * @ModifiedRemark：
 */

public class AboutUsActivity extends BaseActivity {
    @BindView(R.id.leftButton)
    Button leftButton;
    @BindView(R.id.title)
    TextView title;
    @BindView(R.id.tv_version_code)
    TextView tv_version_code;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_about_us);
        ButterKnife.bind(this);
        title.setText("关于我们");
        tv_version_code.setText(StaticField.getVersionName(this) + "");
    }

    @OnClick({R.id.leftButton})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.leftButton:
                finish();
                break;
        }
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected void onPause() {
        super.onPause();
    }

    /**
     * get App versionCode
     *
     * @return
     */
    public String getVersionCode() {
        PackageManager packageManager = getPackageManager();
        PackageInfo packageInfo;
        String versionCode = "";
        try {
            packageInfo = packageManager.getPackageInfo(getPackageName(), 0);
            versionCode = packageInfo.versionCode + "";
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
        return versionCode;
    }


}
